package DFA;

import java.io.IOException;
import java.util.HashMap;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

public class demoTest {
    public static void main(String[] args) throws IOException {
        long start = System.currentTimeMillis();



        HashMap<Integer, int[][]> integerHashMap = new HashMap<>(5);
        ForkJoinPool forkJoinPool= new ForkJoinPool();
        int numEventA1 = 6;
        int numEventA2 = 4;
        int numEventA3 = 6;
        int numEventA4 = 13;
        int[][] DFA1 = new int[numEventA1][3];
        int[][] DFA3 = new int[numEventA3][3];
        int[][] DFA2 = {{1,7,2},{2,8,1},{2,9,3},{3,10,1}};
        int[][] DFA4 = {{1,1,1},{1,2,1},{1,3,1},{1,4,1},{1,5,1},{1,6,1},{2,7,2},{2,8,2},{2,9,2},{2,10,2},{1,11,2}};
        integerHashMap.put(0,DFA1);
        integerHashMap.put(1,DFA2);
        integerHashMap.put(2,DFA1);
        integerHashMap.put(3,DFA3);
        integerHashMap.put(4,DFA4);

        DFA1[0][0] = 1;
        DFA1[0][1] = 1;
        DFA1[0][2] = 2;

        DFA1[1][0] = 2;
        DFA1[1][1] = 2;
        DFA1[1][2] = 1;

        DFA1[2][0] = 2;
        DFA1[2][1] = 3;
        DFA1[2][2] = 3;

        DFA1[3][0] = 3;
        DFA1[3][1] = 4;
        DFA1[3][2] = 2;

        DFA1[4][0] = 3;
        DFA1[4][1] = 5;
        DFA1[4][2] = 4;

        DFA1[5][0] = 4;
        DFA1[5][1] = 6;
        DFA1[5][2] = 1;

        //DFA3初始化
        DFA3[0][0] = 1;
        DFA3[0][1] = 12;
        DFA3[0][2] = 2;

        DFA3[1][0] = 2;
        DFA3[1][1] = 13;
        DFA3[1][2] = 1;

        DFA3[2][0] = 2;
        DFA3[2][1] = 14;
        DFA3[2][2] = 3;

        DFA3[3][0] = 3;
        DFA3[3][1] = 15;
        DFA3[3][2] = 2;

        DFA3[4][0] = 3;

        DFA3[4][1] = 16;
        DFA3[4][2] = 4;

        DFA3[5][0] = 4;
        DFA3[5][1] = 17;
        DFA3[5][2] = 1;
//        Set<Integer> keys2 = integerHashMap.keySet();
//        for (Integer key : keys2) {
//
//
//        }


    //    ForkJoinTask<int [][]> task = new dfaSumTask(0,integerHashMap.size()-1,integerHashMap, readIn);
     //   int [][] result = ForkJoinPool.commonPool().invoke(task);

        fileWrite.writeTXTInial("F:\\","2020");

//        for (int j = 0; j < result.length; j++) {
//            //show里面showState对象showState{start=xBuf{x1=2, x2=2}, way='b', end=xBuf{x1=1, x2=3}}
//            // 0 -> 1 [label= 1 ];
//
//            String sb = result[j][0] + " -> " +  result[j][2]  + " [label= " +  result[j][1] + " ];";
//            //打印输出
//            try {
//                fileWrite.write(sb);
//            } catch (IOException e) {
//                e.printStackTrace();
//            }
//
//        }
//        fileWrite.writeClose();
//        System.out.println(
//                " spend time:"+(System.currentTimeMillis()-start)+"ms");
   }
}
